package com.example.origin.spider.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class ZwfwSafeDTO {


    @JsonProperty("body")
    private BodyDTO body;
    @JsonProperty("header")
    private HeaderDTO header;

    @NoArgsConstructor
    @Data
    public static class BodyDTO {
        @JsonProperty("dataStores")
        private DataStoresDTO dataStores;
        @JsonProperty("parameters")
        private ParametersDTO parameters;

        @NoArgsConstructor
        @Data
        public static class DataStoresDTO {
            @JsonProperty("credit_store")
            private CreditStoreDTO creditStore;

            @NoArgsConstructor
            @Data
            public static class CreditStoreDTO {
                @JsonProperty("pageNumber")
                private Integer pageNumber;
                @JsonProperty("recordCount")
                private Integer recordCount;
                @JsonProperty("pageSize")
                private Integer pageSize;
                @JsonProperty("rowSet")
                private RowSetDTO rowSet;
                @JsonProperty("name")
                private String name;
                @JsonProperty("parameters")
                private ParametersDTO parameters;

                @NoArgsConstructor
                @Data
                public static class RowSetDTO {
                    @JsonProperty("delete")
                    private List<?> delete;
                    @JsonProperty("filter")
                    private List<?> filter;
                    @JsonProperty("primary")
                    private List<PrimaryDTO> primary;

                    @NoArgsConstructor
                    @Data
                    public static class PrimaryDTO {
                        @JsonProperty("TXAMT1")
                        private Integer txamt1;
                        @JsonProperty("BIZDATE")
                        private Long bizdate;
                        @JsonProperty("CORPNAME")
                        private String corpname;
                        @JsonProperty("SAFENAME")
                        private String safename;
                        @JsonProperty("TXAMT2")
                        private Integer txamt2;
                        @JsonProperty("ROWNUM")
                        private Integer rownum;
                        @JsonProperty("RPTDATE")
                        private Long rptdate;
                        @JsonProperty("PAYTYPE")
                        private String paytype;
                        @JsonProperty("TXCODE1")
                        private String txcode1;
                        @JsonProperty("TXCODE2")
                        private String txcode2;
                        @JsonProperty("TXAMT")
                        private Integer txamt;
                        @JsonProperty("CONTRACTNO")
                        private String contractno;
                        @JsonProperty("SAFECODE")
                        private String safecode;
                        @JsonProperty("CORPID")
                        private String corpid;
                        @JsonProperty("COUNTRYCODE")
                        private String countrycode;
                        @JsonProperty("CUSTNAME")
                        private String custname;
                        @JsonProperty("PAYMETHOD")
                        private String paymethod;
                        @JsonProperty("TXCCY")
                        private String txccy;
                        @JsonProperty("RPTNO")
                        private String rptno;
                        @JsonProperty("TXREM")
                        private String txrem;
                        @JsonProperty("USDAMT")
                        private Double usdamt;
                    }
                }

                @NoArgsConstructor
                @Data
                public static class ParametersDTO {
                    @JsonProperty("unieap_form_Button_1")
                    private String unieapFormButton1;
                    @JsonProperty("STARTDATE")
                    private String startdate;
                    @JsonProperty("endDate")
                    private String endDate;
                    @JsonProperty("contractno")
                    private String contractno;
                    @JsonProperty("unieap_form_Button_0")
                    private String unieapFormButton0;
                    @JsonProperty("PAYTYPE")
                    private String paytype;
                    @JsonProperty("ENDDATE")
                    private String enddate;
                    @JsonProperty("CORPID")
                    private String corpid;
                    @JsonProperty("isReportedPayment")
                    private String isReportedPayment;
                    @JsonProperty("QUERYTYPE")
                    private String querytype;
                    @JsonProperty("TYPE")
                    private String type;
                    @JsonProperty("RPTNO")
                    private String rptno;
                    @JsonProperty("startDate")
                    private String startDate;
                    @JsonProperty("isReported")
                    private String isReported;
                }
            }
        }

        @NoArgsConstructor
        @Data
        public static class ParametersDTO {
            @JsonProperty("STARTDATE")
            private String startdate;
            @JsonProperty("OP_TYPE")
            private String opType;
            @JsonProperty("COMMON_ORG_NAME")
            private String commonOrgName;
            @JsonProperty("ENDDATE")
            private String enddate;
            @JsonProperty("COMMON_ORG_CODE")
            private String commonOrgCode;
            @JsonProperty("COMMON_TEL")
            private String commonTel;
            @JsonProperty("CORPID")
            private String corpid;
            @JsonProperty("synCount")
            private String synCount;
            @JsonProperty("COMMON_USER_NAME")
            private String commonUserName;
            @JsonProperty("COMMON_ORG_TYPE")
            private String commonOrgType;
            @JsonProperty("TYPE")
            private String type;
            @JsonProperty("COMMON_USER_CODE")
            private String commonUserCode;
            @JsonProperty("RPTNO")
            private String rptno;
        }
    }

    @NoArgsConstructor
    @Data
    public static class HeaderDTO {
        @JsonProperty("code")
        private Integer code;
        @JsonProperty("message")
        private MessageDTO message;

        @NoArgsConstructor
        @Data
        public static class MessageDTO {
            @JsonProperty("title")
            private String title;
            @JsonProperty("detail")
            private String detail;
        }
    }
}
